package com.nt.train.controller;
import com.nt.train.exception.MyException;
import org.springframework.web.bind.annotation.*;

/**
 * 05-异常演示
 * @author hlf
 * @version 1.0
 * @date 2022/7/28 8:51
 */
@RestController
@RequestMapping("/exception")
public class ExceptionController {

    @RequestMapping("/hello")
    public String hello() throws Exception {
        throw new Exception("发生错误");
    }

    @RequestMapping("/json")
    public String json() throws MyException {
        throw new MyException("发生错误2");
    }

}
